/*
   Playing around in C++
   Implementing a solution for this problem:
		How many ways can you arrange 6 different books, left to right, on a shelf? 
		The answer is: 720
   @Author: George Elias Ferreira da Silva
   @Date: 10/14/2011
*/

#include <iostream>

int fat(int num) {
	std::cout << "num = " << num << std::endl;
	if (num == 1)
		return 1;
	else
		return num * fat(num-1);
}

int main (void) {
	std::cout << "How many ways can you arrange 6 different books, left to right, on a shelf?" << std::endl;
	std::cout << "\tA: You can arrange them in " << fat(6) << " differents ways." << std::endl;
	return 0;
}